package com.hgw.Demo07_ObserverPattern.Exercises22_9_5;

/**
 * Data time:2021/12/19 18:01
 * StudentID:2019112118
 * Author:hgw
 * Description: 二级学院，具体目标
 */
public class Department extends AbstractDepartment{
    public Department(String departmentName) {
        System.out.println(departmentName + "二级学院成立");
        System.out.println("----------------------------------");
        this.departmentName = departmentName;
    }

    @Override
    public void notifyPeople(String departmentName) {
        System.out.println(this.departmentName + "系改名" + departmentName);
        System.out.println("----------------------------------");
        this.departmentName = departmentName;
        for (People people : peoples) {
            people.ChangeName(this);
        }
    }
}
